//============================================================================
// Name        : RecolhaLixoExp.cpp
// Author      : Joao
// Version     :
// Copyright   : Your copyright notice
// Description : 
//============================================================================
#include <cstdio>
#include <fstream>
#include <iostream>
#include <sstream>
#include <stdlib.h>
//#include <Windows.h>
//#include "Utilities.h"
//#include "FileUtilities.h"
#include "ui.h"

void testDijkstra(){
	//vector<Road*> roads;
	//vector<RoadNode*> roadNodes;
	//vector<SubRoad*> subRoads;

	//RoadNode * node1 = new RoadNode(0.0, 4.0, 1, 1, false);
	//RoadNode * node2 = new RoadNode(2.0, 4.0, 2, 2, false);
	//RoadNode * node3 = new RoadNode(0.0, 2.0, 3, 3, false);
	//RoadNode * node4 = new RoadNode(2.0, 2.0, 4, 4, false);
	//RoadNode * node5 = new RoadNode(3.0, 4.0, 5, 5, false);
	//RoadNode * node6 = new RoadNode(0.0, 0.0, 6, 6, false);
	//RoadNode * node7 = new RoadNode(1.0, 1.0, 7, 7, false);
	//RoadNode * node8 = new RoadNode(3.0, 0.0, 8, 8, false);
	//roadNodes.push_back(node1);
	//roadNodes.push_back(node2);
	//roadNodes.push_back(node3);
	//roadNodes.push_back(node4);
	//roadNodes.push_back(node5);
	//roadNodes.push_back(node6);
	//roadNodes.push_back(node7);
	//roadNodes.push_back(node8);
	//RoadMap * roadMap = new RoadMap(roadNodes);

	//Road * road = new Road("Road Name", true, 1);
	//SubRoad * road1 = new SubRoad(1, node1, node3, road);
	//SubRoad * road2 = new SubRoad(2, node3, node6, road);
	//SubRoad * road3 = new SubRoad(3, node3, node2, road);
	//SubRoad * road4 = new SubRoad(4, node3, node4, road);
	//SubRoad * road5 = new SubRoad(5, node2, node4, road);
	//SubRoad * road6 = new SubRoad(6, node2, node5, road);
	//SubRoad * road7 = new SubRoad(7, node5, node4, road);
	//SubRoad * road8 = new SubRoad(8, node5, node8, road);
	//SubRoad * road9 = new SubRoad(9, node4, node8, road);
	//SubRoad * road10 = new SubRoad(10, node6, node8, road);
	//SubRoad * road11 = new SubRoad(11, node3, node7, road);
	//SubRoad * road12 = new SubRoad(12, node7, node4, road);
	//subRoads.push_back(road1 );
	//subRoads.push_back(road2 );
	//subRoads.push_back(road3 );
	//subRoads.push_back(road4 );
	//subRoads.push_back(road5 );
	//subRoads.push_back(road6 );
	//subRoads.push_back(road7 );
	//subRoads.push_back(road8 );
	//subRoads.push_back(road9 );
	//subRoads.push_back(road10);
	//subRoads.push_back(road11);
	//subRoads.push_back(road12);


	//vector<RoadNode*> path;
	////roadMap->dijkstra(node1, node8, &path);
	//for(int i = 0, s = path.size(); i < s; i++){
	//	cout << "Node" << path[i]->getID() << endl;
	//}
	//getchar();
}

int main(void) {

	vector<Road*> roads;
	vector<RoadNode*> roadNodes;
	vector<SubRoad*> subRoads;
	RoadMap * roadMap = new RoadMap(roadNodes, roads, subRoads);
	main_menu(roadMap);


	/*parseFiles(&roads, &roadNodes, &subRoads);
	RoadMap * roadMap = new RoadMap(roadNodes);
	// DEBUG
	//cout << "Start printing..." << endl;
	//printVector(roadNodes);
	//printVector(roads);
	//printVector(subRoads);
	//
	vector<RoadNode*> circuit;
	vector<vector<RoadNode*>> circuits;
	//roadMap->getCircuit(&circuit);
	roadMap->getCircuits(1, &circuits);
	//circuit = circuits[0];

	GraphViewer *gv = new GraphViewer(600, 600, false);
	gv->createWindow(600, 600);
	Sleep(1000);
	parseGraph(roadMap, gv);
	parseCircuitGraph(&circuit, gv);

	//cout << "Circuit: "<< endl;
	//printVector(circuit);

	gv->rearrange();

	if(circuits.size() > 0)
		saveToFile("mySave.txt", &circuits);
	getchar();*/
	//gv->closeWindow();
	return EXIT_SUCCESS;
}